<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" template="/layouts/default.xhtml">
    <ui:define name="title">#{text['login.title']}</ui:define>
    <ui:param name="menu" value="Login"/>
    <ui:param name="bodyId" value="login"/>
    <ui:define name="body">
        <form method="post" id="loginForm" action="#{request.contextPath}/j_security_check"
              onsubmit="saveUsername(this);return validateForm(this)" class="form-signin" autocomplete="off">
            <h2 class="form-signin-heading">
                #{text['login.heading']}
            </h2>
            <c:if test="${param.error != null}">
                <div class="alert alert-danger alert-dismissable">
                    #{text['errors.password.mismatch']}
                </div>
            </c:if>
            <input type="text" name="j_username" id="j_username" class="input-block-level form-control"
                   placeholder="#{text['label.username']}" required="true" tabindex="1"/>
            <input type="password" class="input-block-level form-control" name="j_password" id="j_password" tabindex="2"
                   placeholder="#{text['label.password']}" required="true"/>
            <c:if test="${appConfig['rememberMeEnabled']}">
                <label class="checkbox" for="rememberMe">
                    <input type="checkbox" class="checkbox" name="_spring_security_remember_me" id="rememberMe"
                           tabindex="3"/>
                    #{text['login.rememberMe']}</label>
            </c:if>

            <button type="submit" class="btn btn-lg btn-primary btn-block" name="login" tabindex="4">
                #{text['button.login']}
            </button>
        </form>

		<!--  
        <p>
            <h:outputFormat value="#{text['login.signup']}" escape="false">
                <f:param value="#{request.contextPath}/signup"/>
            </h:outputFormat>
        </p>
        -->

        <p><h:outputText value="#{text['login.passwordHint']}" escape="false"/></p>
    </ui:define>

    <ui:define name="scripts">
        <ui:include src="/scripts/login.js"/>
    </ui:define>

</ui:composition>
</html>